minetest.register_node("furnacerecipes:bintrash",{
    description = "Put a trash bin in your life. Get rid of those big amount of cobble and herbs.",
    -- Sin description no salen en la lista de recetas aunque se puedan craftear.
    drawtype = "nodebox",
    tiles = {"furnacerecipes_bintrash_top.png"
        ,"example_00.png"
        ,"example_01.png"
        ,"example_01.png"
        ,"example_00.png"
        ,"example_01.png"
    },
    groups = {cracky = 1},
    on_rightclick = function(pos, node, clicker, itemstack, pointed_thing)
        if clicker:is_player() then
	        local nodename = itemstack:get_name()
            minetest.chat_send_player("singleplayer","Objeto que golpea "..  nodename) 
            
            -- TRACEO
            -- minetest.chat_send_player("singleplayer", "Es nil? " .. tostring(nodename == nil))
            -- minetest.chat_send_player("singleplayer", "Es ''? " .. tostring(nodename == ''))
            -- minetest.chat_send_player("singleplayer", "Es player? " .. tostring(clicker:is_player()))

            -- GOLPEAR CON LA MANO: itemstack name es ''   clicker:is_player true
            -- GOLPEAR CON OBJETO: itemstrack tiene name  clicker:is_player true
            -- ----------------------
           
	        --if nodename:match("leaves") then
			if true then	
                if not minetest.settings:get_bool("creative_mode") then
                    itemstack:take_item(itemstack:get_count())
                end
                -- minetest.swap_node(pos, { name = "pecera_pirana:pecera_llena" })
                -- local timer = minetest.get_node_timer(pos)
                -- timer:start(10.5) -- in seconds
            else
                minetest.chat_send_player(clicker:get_player_name(), S("¡Necesitas peces!"))
                return itemstack
	        end
        end
        -- itemstack.remove()
        return itemstack
    end -- fin callback
})

minetest.register_craft({
    type = "shaped",
    output = "furnacerecipes:bintrash",
    recipe = {
         {"default:tin_ingot",""                 ,"default:tin_ingot"}
        ,{"default:tin_ingot",""                 ,"default:tin_ingot"}
        ,{"default:tin_ingot","default:tin_ingot","default:tin_ingot"}
    }
})
-- minetest.register_craftitem()

